home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEmeshTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  6.6 KB  |  232 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //
  20. //    Creation Date:    May 29, 1997
  21. //    Author:            ajp
  22. //
  23. //    Procedure Name:
  24. //    AEmeshTemplate
  25. //
  26. //    Description Name;
  27. //    Creates the attribute editor controls for the mesh node
  28. //
  29. //    Input Value:
  30. //    nodeName
  31. //
  32. //    Output Value:
  33. //    None
  34. //
  35.  
  36. global proc checkMeshDisplayBorder ( string $nodeName )
  37. {
  38.     string $nodeAttr = $nodeName + ".displayBorders";
  39.     int $value = `getAttr $nodeAttr`;
  40.  
  41.     if ( $value ) {
  42.         editorTemplate -dimControl $nodeName "borderWidth" false;
  43.     } else {
  44.         editorTemplate -dimControl $nodeName "borderWidth" true;
  45.     }
  46. }
  47.  
  48. global proc checkMeshUseMaxSubd ( string $nodeName )
  49. {
  50.   string $nodeAttr = $nodeName + ".useMaxSubdivisions";
  51.   int $value = `getAttr $nodeAttr`;
  52.  
  53.     if ( $value ) {
  54.       editorTemplate -dimControl $nodeName "maxSubd" false;
  55.     } else {
  56.       editorTemplate -dimControl $nodeName "maxSubd" true;
  57.     }
  58. }
  59.  
  60. global proc checkMeshUseMinScreen ( string $nodeName )
  61. {
  62.     string $nodeAttr = $nodeName + ".useMinScreen";
  63.     int $value = `getAttr $nodeAttr`;
  64.  
  65.     if ( $value ) {
  66.         editorTemplate -dimControl $nodeName "minScreen" false;
  67.     } else {
  68.         editorTemplate -dimControl $nodeName "minScreen" true;
  69.     }
  70. }
  71.  
  72. global proc checkMeshUseMaxEdgeLength ( string $nodeName )
  73. {
  74.     string $nodeAttr = $nodeName + ".useMaxEdgeLength";
  75.     int $value = `getAttr $nodeAttr`;
  76.  
  77.     if ( $value ) {
  78.         editorTemplate -dimControl $nodeName "maxEdgeLength" false;
  79.     } else {
  80.         editorTemplate -dimControl $nodeName "maxEdgeLength" true;
  81.     }
  82. }
  83.  
  84. global proc checkMeshUseMaxUv ( string $nodeName )
  85. {
  86.     string $nodeAttr = $nodeName + ".useMaxUV";
  87.     int $value = `getAttr $nodeAttr`;
  88.  
  89.     if ( $value ) {
  90.         editorTemplate -dimControl $nodeName "maxUv" false;
  91.     } else {
  92.         editorTemplate -dimControl $nodeName "maxUv" true;
  93.     }
  94. }
  95.  
  96.  
  97.  
  98. global proc checkMeshUseMinEdgeLength ( string $nodeName )
  99. {
  100.     string $nodeAttr = $nodeName + ".useMinEdgeLength";
  101.     int $value = `getAttr $nodeAttr`;
  102.  
  103.     if ( $value ) {
  104.         editorTemplate -dimControl $nodeName "minEdgeLength" false;
  105.     } else {
  106.         editorTemplate -dimControl $nodeName "minEdgeLength" true;
  107.     }
  108. }
  109.  
  110. global proc checkMeshDisplayNormals ( string $nodeName )
  111. {
  112.     string $nodeAttr = $nodeName + ".displayNormal";
  113.     int $value = `getAttr $nodeAttr`;
  114.  
  115.     if ( $value ) {
  116.         editorTemplate -dimControl $nodeName "normalSize" false;
  117.         editorTemplate -dimControl $nodeName "normalType" false;
  118.     } else {
  119.         editorTemplate -dimControl $nodeName "normalSize" true;
  120.         editorTemplate -dimControl $nodeName "normalType" true;
  121.     }
  122. }
  123.  
  124. global proc checkMeshDisplayVertices ( string $nodeName )
  125. {
  126.     string $nodeAttr = $nodeName + ".displayVertices";
  127.     int $value = `getAttr $nodeAttr`;
  128.  
  129.     if ( $value ) {
  130.         editorTemplate -dimControl $nodeName "vertexBackfaceCulling" false;
  131.     } else {
  132.         editorTemplate -dimControl $nodeName "vertexBackfaceCulling" true;
  133.     }
  134. }
  135.  
  136. global proc AEmeshTemplate( string $nodeName )
  137. {
  138.     editorTemplate -beginScrollLayout;
  139.  
  140.  
  141.         editorTemplate -beginLayout "Tessellation Attributes";
  142.  
  143.             editorTemplate -addControl "maxTriangles";
  144.  
  145.             editorTemplate -addControl "useMaxSubdivisions" 
  146.                         "checkMeshUseMaxSubd";
  147.             editorTemplate -addControl "maxSubd";
  148.  
  149.             editorTemplate -addControl "useMinScreen"
  150.                         "checkMeshUseMinScreen";
  151.             editorTemplate -addControl "minScreen";
  152.  
  153.             editorTemplate -addControl "useMaxUV"
  154.                         "checkMeshUseMaxUv";
  155.             editorTemplate -addControl "maxUv";
  156.  
  157.             editorTemplate -addControl "useMinEdgeLength"
  158.                         "checkMeshUseMinEdgeLength";
  159.             editorTemplate -addControl "minEdgeLength";
  160.  
  161.             editorTemplate -addControl "useMaxEdgeLength"
  162.                         "checkMeshUseMaxEdgeLength";
  163.             editorTemplate -addControl "maxEdgeLength";
  164.  
  165.         editorTemplate -endLayout;
  166.  
  167.         editorTemplate -beginLayout "Mesh Component Display";
  168.             editorTemplate -beginNoOptimize;
  169.             editorTemplate -addControl "displayVertices";
  170.                         //"checkMeshDisplayVertices";
  171.             editorTemplate -addControl "vertexBackfaceCulling";
  172.             editorTemplate -addControl "backfaceCulling";
  173.             editorTemplate -endNoOptimize;
  174.     
  175.             editorTemplate -addSeparator;
  176.  
  177.             editorTemplate -addControl "displayBorders" 
  178.                         "checkMeshDisplayBorder";
  179.             editorTemplate -addControl "borderWidth";
  180.     
  181.             editorTemplate -addSeparator;
  182.  
  183.             editorTemplate -addControl "displayEdges";    
  184.             editorTemplate -beginNoOptimize;
  185.             editorTemplate -addControl "displayCenter";
  186.             editorTemplate -addControl "displayTriangles";
  187.             editorTemplate -addControl "displayUVs";
  188.             editorTemplate -endNoOptimize;
  189.     
  190.             editorTemplate -addSeparator;
  191.  
  192.             editorTemplate -addControl "displayNormal" 
  193.                         "checkMeshDisplayNormals";
  194.             editorTemplate -addControl "normalSize";
  195.             editorTemplate -addControl "normalType";
  196.  
  197.             editorTemplate -addSeparator;
  198.  
  199.             editorTemplate -suppress "displayItemNumbers";
  200.             editorTemplate -addControl "displayNonPlanar";
  201.  
  202.             editorTemplate -addControl "materialBlend";
  203.         editorTemplate -endLayout;
  204.  
  205.         editorTemplate -beginLayout "Mesh Controls";
  206.             editorTemplate -addControl "currentUVSet";
  207.             editorTemplate -addControl "allowTopologyMod";
  208.         editorTemplate -endLayout;
  209.  
  210.         // include/call base class/node attributes
  211.         AEsurfaceShapeTemplate $nodeName;
  212.  
  213.         // supressed attributes
  214.         editorTemplate -suppress "inMesh";
  215.         editorTemplate -suppress "outMesh";
  216.         editorTemplate -suppress "cachedInMesh";
  217.         editorTemplate -suppress "useNumTriangles";
  218.         editorTemplate -suppress "numTriangles";
  219.         editorTemplate -suppress "pnts";
  220.         editorTemplate -suppress "colors";
  221.         editorTemplate -suppress "colorPerVertex";
  222.         editorTemplate -suppress "normalPerVertex";
  223.         editorTemplate -suppress "uvSet";
  224.         editorTemplate -suppress "normals";
  225.         editorTemplate -suppress "displayFacesWithGroupId";
  226.         editorTemplate -suppress "userTrg";
  227.  
  228.     editorTemplate -addExtraControls;
  229.     editorTemplate -endScrollLayout;
  230.  
  231. }
  232.